package com.zq.zhufengfm.entity.discoverrecommened;

import com.zq.zhufengfm.entity.AlbumBasic;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Project_name : ZhuFengFM
 * Author : zhaoQiang
 * Date : 2015/10/21,11:54
 * Email : zhaoq_hero@163.com
 */


/**
 * 发现推荐内部的一个专辑推荐，最后可组合成一个"小编推荐"
 */
public class AlbumRecommend extends AlbumBasic {
    /*
    {
        "albumId": 344497,
        "coverLarge": "http://fdfs.xmcdn.com/group6/M02/35/45/wKgDhFTg4w_SDkc9AAT-fXngGBY184_mobile_large.jpg",
        "title": "黑先生在麦田咖啡馆",
        "tags": "民谣,80后,文艺",
        "tracks": 117,

        "playsCounts": 917714,
        "isFinished": 0,
        "trackId": 7898099,
        "trackTitle": "几米：音乐与绘本的美好邂逅"
      },
    **/
    private Long playsCounts;
    private int isFinished;
    private long trackId;
    private String trackTitle;

    public void parseJSON(JSONObject jsonObject) throws JSONException {

        super.parseJSON(jsonObject);//先调用父类

        if (jsonObject != null) {
            //默认数据  为 0
            playsCounts = jsonObject.optLong("playsCounts",0);

            isFinished = jsonObject.optInt("isFinished",0);

            trackId = jsonObject.getLong("trackId");

            trackTitle = jsonObject.getString("trackTitle");
        }
    }

    public long getTrackId() {
        return trackId;
    }

    public String getTrackTitle() {
        return trackTitle;
    }

    @Override
    public String toString() {
        return "AlbumRecommend{" +
                "playsCounts=" + playsCounts +
                ", isFinished=" + isFinished +
                ", trackId=" + trackId +
                ", trackTitle='" + trackTitle + '\'' +
                '}';
    }
}
